package com.neusoft.elmboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.elmboot.po.User;
import com.neusoft.elmboot.service.UserService;

@CrossOrigin
@RestController
@RequestMapping("/UserController")
public class UserController {

	//注入
	@Autowired
	private UserService userService;
	
	@RequestMapping("/getUserByIdByPass")
	public User getUserByIdByPass(User user){
		return userService.getUserByIdByPass(user);
	}
	
	@RequestMapping("/getUserById")
	public int getUserById(User u) {
		int i = userService.getUserById(u.getUserId());
		return i;
	}
	
	@RequestMapping("/saveUser")
	public int saveUser(User u) {
		return userService.saveUser(u);
	}
}
